package com.neuedu.yyzx.controller;


import com.neuedu.yyzx.config.CommonResult;
import com.neuedu.yyzx.entity.UserRole;
import com.neuedu.yyzx.service.IUserRoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 用户角色 前端控制器
 * </p>
 *
 * @author 第7组....
 * @since 2021-05-22
 */
@RestController
@RequestMapping("/userRole")
public class UserRoleController {
    @Resource
    IUserRoleService umsUserRoleService;
    @PostMapping("/save")
    CommonResult save(UserRole umsUserRole) {
        return CommonResult.success(umsUserRoleService.saveOrUpdate(umsUserRole));
    }
    @GetMapping("/getByUserId")
    CommonResult getByUserId(Integer userId) {
        return CommonResult.success(umsUserRoleService.getByUserId(userId));
    }
}
